package com.example.spring.web.demo.service;

import org.springframework.stereotype.Service;

import java.util.concurrent.TimeUnit;

/**
 * @ClassName TestService
 * @Description
 * @Author lichuanqi
 * @Date 2021/11/18 17:53
 * @Version 1.0
 **/
@Service
public class TestService {

    public String sayHello(String name) {
        System.out.println("TestService sayHello");
        return "hello2.0:"+name;
    }

    public Integer add(Integer arg1, Integer arg2) {
        System.out.println("TestService add");
        return arg1+arg2;
    }

    public String sleep(Integer seconds) {
        System.out.println("TestService sleep");
        try {
            TimeUnit.SECONDS.sleep(seconds);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "finish";
    }
}
